package com.djf.eg.controller;

import java.util.List;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.djf.eg.entity.Demo;
import com.djf.eg.service.DemoService;

@RestController
@RequestMapping("demo")
public class DemoController extends DBaseController {
	
	private static final Logger logger = LoggerFactory.getLogger(DemoController.class); 
	@Autowired
	DemoService demoService;
	
//	@RequiresRoles("admin")
//    @RequiresPermissions("demo:view")
//	@GetMapping
//	public List<Demo> getAll() {
//		logger.debug("Invoking... DemoController.getAll");
//		return demoService.getAll();
//	}
//	
//	@GetMapping("/test")
//	public String test() {
////		return demoService.getAll();
//		return "test success";
//	}
//	
//	@PostMapping
//	public Demo addDemo(@RequestBody Demo demo) {
//		logger.debug("Debug Invoking... DemoController.addDemo" + demo.toString());
//		 logger.info("Info Invoking... DemoController.addDemo" + demo.toString());
//		 logger.error("Error Invoking... DemoController.addDemo" + demo.toString());
//		return demoService.addDemo(demo);
////		throw new DRuntimeException("1", "2", "3");
//	}
}
